
package com.wobaby.security;


public class Privilege
{

    public Privilege(short level)
    {
        this.level = level;
    }

    public short getLevel()
    {
        return level;
    }

    public String toString()
    {
        switch(level)
        {
        case 1: // '\001'
            return "Limited Access";

        case 2: // '\002'
            return "Full Access";

        case 3: // '\003'
            return "Power";

        case 4: // '\004'
            return "Admin";
        }
        return "Privilege: None";
    }

    public static final short NONE = 0;
    public static final short SENTINEL_READ = 1;
    public static final short SENTINEL_WRITE = 2;
    public static final short SENTINEL_POWER = 3;
    public static final short SENTINEL_ADMIN = 4;
    public static final Privilege READ = new Privilege((short)1);
    public static final Privilege WRITE = new Privilege((short)2);
    public static final Privilege POWER = new Privilege((short)3);
    public static final Privilege ADMIN = new Privilege((short)4);
    private short level;

}